<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>注册页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Pragma" content="no-cache">
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <link href="${basePath}/resources/css/portal.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script>
    function sendMail() {
        disableSend();
        $.post("${basePath}/reg/sendMail?r" + Math.random(), {
            mail: $("#email").val(),
            mailKey: $("#mailKey").val()
        }, function (data) {
            if (data == "success") {
            } else {
                layer.alert("发送失败！", {icon: 5})
            }
        });
    }

    function disableSend() {
        var i = 60;
        var sit = window.setInterval(function () {
            $("#submit").val("重新发送(" + (i--) + ")");
        }, 1000);
        window.setTimeout(function () {
            window.clearInterval(sit);
            $("#submit").val("重新发送");
            $("#submit").attr("disabled", false).css("background", "#3aa6f3");
        }, 62000);
        $("#submit").attr("disabled", true).css("background", "#dedede");
    }
</script>
<div id="main-page">
    <div class="manage-content">
        <div class="result">
            <div class="result-content">
                <div class="um-email">
                    <div class="um-middle-content"><i class="email-ico"></i>

                        <p class="email-send">邮箱注册邮件已发送到 <strong>${mail}</strong></p>
                        <input type="hidden" id="email" value="${mail}"/>
                        <input type="hidden" id="mailKey" value="${mailKey}"/>

                        <p class="email-period">请在24小时内点击邮箱中的邮箱注册链接，完成注册！</p>

                        <div class="email-resend">
                            <span class="txt">未收到邮件！</span><input id="submit" type="button" value="重新发送"
                                                                  class="regist-submit-btn"
                                                                  disabled onclick="sendMail();"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    disableSend();
</script>
</body>
</html>
